package com.oocl.crm.command.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.exception.ParameterErrorException;
import com.oocl.crm.service.BusinessService;

/**
 * L 指令
 * @author GANAB
 */
public class LookUpCommand extends Command{
	public LookUpCommand() {

	}
	
	public LookUpCommand(String params) {
		super(params);
	}
	
	/**
	 * 获取查询的参数
	 * @return
	 * @throws ParameterErrorException
	 */
	public String[] getQueryField() throws ParameterErrorException{
		
		if (this.getParams() != null) {
			// 校验格式
			if (this.getParams() .matches(BusinessService.USER_FIELDS_REGEX) || this.getParams() == "") {
				// 正则已经能排除格式问题，直接取数据
				String[] fields = this.getParams().split(",");
				return fields;
			}
		}
		throw new ParameterErrorException("Lookup user exception: parameter does not conform to the format! ");
	}

}
